import java.util.Arrays;

public class Test {
    public static void sort(int[] array) {
        for (int j = 0; j < array.length; j++) {
            for (int i = 0; i < array.length - j - 1; i++) {
                if(array[i] > array[i+1]){
                    int tmp = array[i];
                    array[i] = array[i+1];
                    array[i+1] = tmp;
                }
            }
        }
        return;
    }
    public static void main(String[] args) {
        int[] array = new int[]{3,5,7,6,1,8};//给定一个整型数组, 实现简单的冒泡排序(升序排序)
        sort(array);
        System.out.println(Arrays.toString(array));
    }
}
